Integrand size = 33, antiderivative size = 552 \[ \int \cos ^2(e+f x) (a+b \sin (e+f x))^2 (c+d \sin (e+f x))^n \, dx=\frac {\left (2 a^2 d^2 (3+n)-4 a b c d (4+n)+b^2 \left (6 c^2-d^2 (3+n)\right )\right ) \cos (e+f x) (c+d \sin (e+f x))^{1+n}}{d^3 f (2+n) (3+n) (4+n)}-\frac {b (3 b c-2 a d) \cos (e+f x) \sin (e+f x) (c+d \sin (e+f x))^{1+n}}{d^2 f (3+n) (4+n)}+\frac {\cos (e+f x) (a+b \sin (e+f x))^2 (c+d \sin (e+f x))^{1+n}}{d f (4+n)}-\frac {\sqrt {2} (c+d) \left (a^2 c d^2 \left (12+7 n+n^2\right )-2 a b d (4+n) \left (2 c^2-d^2 (2+n)\right )+b^2 c \left (6 c^2-d^2 \left (3-n-n^2\right )\right )\right ) \operatorname {AppellF1}\left (\frac {1}{2},\frac {1}{2},-1-n,\frac {3}{2},\frac {1}{2} (1-\sin (e+f x)),\frac {d (1-\sin (e+f x))}{c+d}\right ) \cos (e+f x) (c+d \sin (e+f x))^n \left (\frac {c+d \sin (e+f x)}{c+d}\right )^{-n}}{d^4 f (2+n) (3+n) (4+n) \sqrt {1+\sin (e+f x)}}-\frac {\sqrt {2} \left (c^2-d^2\right ) \left (4 a b c d (4+n)-a^2 d^2 \left (12+7 n+n^2\right )-b^2 \left (6 c^2+d^2 \left (3+4 n+n^2\right )\right )\right ) \operatorname {AppellF1}\left (\frac {1}{2},\frac {1}{2},-n,\frac {3}{2},\frac {1}{2} (1-\sin (e+f x)),\frac {d (1-\sin (e+f x))}{c+d}\right ) \cos (e+f x) (c+d \sin (e+f x))^n \left (\frac {c+d \sin (e+f x)}{c+d}\right )^{-n}}{d^4 f (2+n) (3+n) (4+n) \sqrt {1+\sin (e+f x)}} \]
[Out]
Time = 1.00 (sec) , antiderivative size = 552, normalized size of antiderivative = 1.00, number of steps used = 11, number of rules used = 8, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.242, Rules used = {3001, 3129, 3112, 3102, 2835, 2744, 144, 143} \[ \int \cos ^2(e+f x) (a+b \sin (e+f x))^2 (c+d \sin (e+f x))^n \, dx=-\frac {\sqrt {2} \left (c^2-d^2\right ) \cos (e+f x) \left (-a^2 d^2 \left (n^2+7 n+12\right )+4 a b c d (n+4)-\left (b^2 \left (6 c^2+d^2 \left (n^2+4 n+3\right )\right )\right )\right ) (c+d \sin (e+f x))^n \left (\frac {c+d \sin (e+f x)}{c+d}\right )^{-n} \operatorname {AppellF1}\left (\frac {1}{2},\frac {1}{2},-n,\frac {3}{2},\frac {1}{2} (1-\sin (e+f x)),\frac {d (1-\sin (e+f x))}{c+d}\right )}{d^4 f (n+2) (n+3) (n+4) \sqrt {\sin (e+f x)+1}}-\frac {\sqrt {2} (c+d) \cos (e+f x) \left (a^2 c d^2 \left (n^2+7 n+12\right )-2 a b d (n+4) \left (2 c^2-d^2 (n+2)\right )+b^2 \left (6 c^3-c d^2 \left (-n^2-n+3\right )\right )\right ) (c+d \sin (e+f x))^n \left (\frac {c+d \sin (e+f x)}{c+d}\right )^{-n} \operatorname {AppellF1}\left (\frac {1}{2},\frac {1}{2},-n-1,\frac {3}{2},\frac {1}{2} (1-\sin (e+f x)),\frac {d (1-\sin (e+f x))}{c+d}\right )}{d^4 f (n+2) (n+3) (n+4) \sqrt {\sin (e+f x)+1}}+\frac {\cos (e+f x) \left (2 a^2 d^2 (n+3)-4 a b c d (n+4)+b^2 \left (6 c^2-d^2 (n+3)\right )\right ) (c+d \sin (e+f x))^{n+1}}{d^3 f (n+2) (n+3) (n+4)}-\frac {b (3 b c-2 a d) \sin (e+f x) \cos (e+f x) (c+d \sin (e+f x))^{n+1}}{d^2 f (n+3) (n+4)}+\frac {\cos (e+f x) (a+b \sin (e+f x))^2 (c+d \sin (e+f x))^{n+1}}{d f (n+4)} \]
[In]
[Out]
Rule 143
Rule 144
Rule 2744
Rule 2835
Rule 3001
Rule 3102
Rule 3112
Rule 3129
Rubi steps \begin{align*} \text {integral}& = \int (a+b \sin (e+f x))^2 (c+d \sin (e+f x))^n \left (1-\sin ^2(e+f x)\right ) \, dx \\ & = \frac {\cos (e+f x) (a+b \sin (e+f x))^2 (c+d \sin (e+f x))^{1+n}}{d f (4+n)}+\frac {\int (a+b \sin (e+f x)) (c+d \sin (e+f x))^n \left (-2 b c+3 a d+(a c+b d) \sin (e+f x)+(3 b c-2 a d) \sin ^2(e+f x)\right ) \, dx}{d (4+n)} \\ & = -\frac {b (3 b c-2 a d) \cos (e+f x) \sin (e+f x) (c+d \sin (e+f x))^{1+n}}{d^2 f (3+n) (4+n)}+\frac {\cos (e+f x) (a+b \sin (e+f x))^2 (c+d \sin (e+f x))^{1+n}}{d f (4+n)}+\frac {\int (c+d \sin (e+f x))^n \left (3 b^2 c^2+3 a^2 d^2 (3+n)-2 a b c d (4+n)+d \left (b^2 c n+a^2 c (3+n)+2 a b d (4+n)\right ) \sin (e+f x)-\left (2 a^2 d^2 (3+n)-4 a b c d (4+n)+b^2 \left (6 c^2-d^2 (3+n)\right )\right ) \sin ^2(e+f x)\right ) \, dx}{d^2 (3+n) (4+n)} \\ & = \frac {\left (2 a^2 d^2 (3+n)-4 a b c d (4+n)+b^2 \left (6 c^2-d^2 (3+n)\right )\right ) \cos (e+f x) (c+d \sin (e+f x))^{1+n}}{d^3 f (2+n) (3+n) (4+n)}-\frac {b (3 b c-2 a d) \cos (e+f x) \sin (e+f x) (c+d \sin (e+f x))^{1+n}}{d^2 f (3+n) (4+n)}+\frac {\cos (e+f x) (a+b \sin (e+f x))^2 (c+d \sin (e+f x))^{1+n}}{d f (4+n)}+\frac {\int (c+d \sin (e+f x))^n \left (d \left (2 a b c d n (4+n)+a^2 d^2 \left (12+7 n+n^2\right )-b^2 \left (3 c^2 n-d^2 \left (3+4 n+n^2\right )\right )\right )+\left (a^2 c d^2 \left (12+7 n+n^2\right )-2 a b d (4+n) \left (2 c^2-d^2 (2+n)\right )+b^2 \left (6 c^3-c d^2 \left (3-n-n^2\right )\right )\right ) \sin (e+f x)\right ) \, dx}{d^3 (2+n) (3+n) (4+n)} \\ & = \frac {\left (2 a^2 d^2 (3+n)-4 a b c d (4+n)+b^2 \left (6 c^2-d^2 (3+n)\right )\right ) \cos (e+f x) (c+d \sin (e+f x))^{1+n}}{d^3 f (2+n) (3+n) (4+n)}-\frac {b (3 b c-2 a d) \cos (e+f x) \sin (e+f x) (c+d \sin (e+f x))^{1+n}}{d^2 f (3+n) (4+n)}+\frac {\cos (e+f x) (a+b \sin (e+f x))^2 (c+d \sin (e+f x))^{1+n}}{d f (4+n)}+\frac {\left (a^2 c d^2 \left (12+7 n+n^2\right )-2 a b d (4+n) \left (2 c^2-d^2 (2+n)\right )+b^2 \left (6 c^3-c d^2 \left (3-n-n^2\right )\right )\right ) \int (c+d \sin (e+f x))^{1+n} \, dx}{d^4 (2+n) (3+n) (4+n)}+\frac {\left (\left (c^2-d^2\right ) \left (4 a b c d (4+n)-a^2 d^2 \left (12+7 n+n^2\right )-b^2 \left (6 c^2+d^2 \left (3+4 n+n^2\right )\right )\right )\right ) \int (c+d \sin (e+f x))^n \, dx}{d^4 (2+n) (3+n) (4+n)} \\ & = \frac {\left (2 a^2 d^2 (3+n)-4 a b c d (4+n)+b^2 \left (6 c^2-d^2 (3+n)\right )\right ) \cos (e+f x) (c+d \sin (e+f x))^{1+n}}{d^3 f (2+n) (3+n) (4+n)}-\frac {b (3 b c-2 a d) \cos (e+f x) \sin (e+f x) (c+d \sin (e+f x))^{1+n}}{d^2 f (3+n) (4+n)}+\frac {\cos (e+f x) (a+b \sin (e+f x))^2 (c+d \sin (e+f x))^{1+n}}{d f (4+n)}+\frac {\left (\left (a^2 c d^2 \left (12+7 n+n^2\right )-2 a b d (4+n) \left (2 c^2-d^2 (2+n)\right )+b^2 \left (6 c^3-c d^2 \left (3-n-n^2\right )\right )\right ) \cos (e+f x)\right ) \text {Subst}\left (\int \frac {(c+d x)^{1+n}}{\sqrt {1-x} \sqrt {1+x}} \, dx,x,\sin (e+f x)\right )}{d^4 f (2+n) (3+n) (4+n) \sqrt {1-\sin (e+f x)} \sqrt {1+\sin (e+f x)}}+\frac {\left (\left (c^2-d^2\right ) \left (4 a b c d (4+n)-a^2 d^2 \left (12+7 n+n^2\right )-b^2 \left (6 c^2+d^2 \left (3+4 n+n^2\right )\right )\right ) \cos (e+f x)\right ) \text {Subst}\left (\int \frac {(c+d x)^n}{\sqrt {1-x} \sqrt {1+x}} \, dx,x,\sin (e+f x)\right )}{d^4 f (2+n) (3+n) (4+n) \sqrt {1-\sin (e+f x)} \sqrt {1+\sin (e+f x)}} \\ & = \frac {\left (2 a^2 d^2 (3+n)-4 a b c d (4+n)+b^2 \left (6 c^2-d^2 (3+n)\right )\right ) \cos (e+f x) (c+d \sin (e+f x))^{1+n}}{d^3 f (2+n) (3+n) (4+n)}-\frac {b (3 b c-2 a d) \cos (e+f x) \sin (e+f x) (c+d \sin (e+f x))^{1+n}}{d^2 f (3+n) (4+n)}+\frac {\cos (e+f x) (a+b \sin (e+f x))^2 (c+d \sin (e+f x))^{1+n}}{d f (4+n)}-\frac {\left ((-c-d) \left (a^2 c d^2 \left (12+7 n+n^2\right )-2 a b d (4+n) \left (2 c^2-d^2 (2+n)\right )+b^2 \left (6 c^3-c d^2 \left (3-n-n^2\right )\right )\right ) \cos (e+f x) (c+d \sin (e+f x))^n \left (-\frac {c+d \sin (e+f x)}{-c-d}\right )^{-n}\right ) \text {Subst}\left (\int \frac {\left (-\frac {c}{-c-d}-\frac {d x}{-c-d}\right )^{1+n}}{\sqrt {1-x} \sqrt {1+x}} \, dx,x,\sin (e+f x)\right )}{d^4 f (2+n) (3+n) (4+n) \sqrt {1-\sin (e+f x)} \sqrt {1+\sin (e+f x)}}+\frac {\left (\left (c^2-d^2\right ) \left (4 a b c d (4+n)-a^2 d^2 \left (12+7 n+n^2\right )-b^2 \left (6 c^2+d^2 \left (3+4 n+n^2\right )\right )\right ) \cos (e+f x) (c+d \sin (e+f x))^n \left (-\frac {c+d \sin (e+f x)}{-c-d}\right )^{-n}\right ) \text {Subst}\left (\int \frac {\left (-\frac {c}{-c-d}-\frac {d x}{-c-d}\right )^n}{\sqrt {1-x} \sqrt {1+x}} \, dx,x,\sin (e+f x)\right )}{d^4 f (2+n) (3+n) (4+n) \sqrt {1-\sin (e+f x)} \sqrt {1+\sin (e+f x)}} \\ & = \frac {\left (2 a^2 d^2 (3+n)-4 a b c d (4+n)+b^2 \left (6 c^2-d^2 (3+n)\right )\right ) \cos (e+f x) (c+d \sin (e+f x))^{1+n}}{d^3 f (2+n) (3+n) (4+n)}-\frac {b (3 b c-2 a d) \cos (e+f x) \sin (e+f x) (c+d \sin (e+f x))^{1+n}}{d^2 f (3+n) (4+n)}+\frac {\cos (e+f x) (a+b \sin (e+f x))^2 (c+d \sin (e+f x))^{1+n}}{d f (4+n)}-\frac {\sqrt {2} (c+d) \left (a^2 c d^2 \left (12+7 n+n^2\right )-2 a b d (4+n) \left (2 c^2-d^2 (2+n)\right )+b^2 \left (6 c^3-c d^2 \left (3-n-n^2\right )\right )\right ) \operatorname {AppellF1}\left (\frac {1}{2},\frac {1}{2},-1-n,\frac {3}{2},\frac {1}{2} (1-\sin (e+f x)),\frac {d (1-\sin (e+f x))}{c+d}\right ) \cos (e+f x) (c+d \sin (e+f x))^n \left (\frac {c+d \sin (e+f x)}{c+d}\right )^{-n}}{d^4 f (2+n) (3+n) (4+n) \sqrt {1+\sin (e+f x)}}-\frac {\sqrt {2} \left (c^2-d^2\right ) \left (4 a b c d (4+n)-a^2 d^2 \left (12+7 n+n^2\right )-b^2 \left (6 c^2+d^2 \left (3+4 n+n^2\right )\right )\right ) \operatorname {AppellF1}\left (\frac {1}{2},\frac {1}{2},-n,\frac {3}{2},\frac {1}{2} (1-\sin (e+f x)),\frac {d (1-\sin (e+f x))}{c+d}\right ) \cos (e+f x) (c+d \sin (e+f x))^n \left (\frac {c+d \sin (e+f x)}{c+d}\right )^{-n}}{d^4 f (2+n) (3+n) (4+n) \sqrt {1+\sin (e+f x)}} \\ \end{align*}
\[ \int \cos ^2(e+f x) (a+b \sin (e+f x))^2 (c+d \sin (e+f x))^n \, dx=\int \cos ^2(e+f x) (a+b \sin (e+f x))^2 (c+d \sin (e+f x))^n \, dx \]
[In]
[Out]
\[\int \left (\cos ^{2}\left (f x +e \right )\right ) \left (a +b \sin \left (f x +e \right )\right )^{2} \left (c +d \sin \left (f x +e \right )\right )^{n}d x\]
[In]
[Out]
\[ \int \cos ^2(e+f x) (a+b \sin (e+f x))^2 (c+d \sin (e+f x))^n \, dx=\int { {\left (b \sin \left (f x + e\right ) + a\right )}^{2} {\left (d \sin \left (f x + e\right ) + c\right )}^{n} \cos \left (f x + e\right )^{2} \,d x } \]
[In]
[Out]
Timed out. \[ \int \cos ^2(e+f x) (a+b \sin (e+f x))^2 (c+d \sin (e+f x))^n \, dx=\text {Timed out} \]
[In]
[Out]
\[ \int \cos ^2(e+f x) (a+b \sin (e+f x))^2 (c+d \sin (e+f x))^n \, dx=\int { {\left (b \sin \left (f x + e\right ) + a\right )}^{2} {\left (d \sin \left (f x + e\right ) + c\right )}^{n} \cos \left (f x + e\right )^{2} \,d x } \]
[In]
[Out]
\[ \int \cos ^2(e+f x) (a+b \sin (e+f x))^2 (c+d \sin (e+f x))^n \, dx=\int { {\left (b \sin \left (f x + e\right ) + a\right )}^{2} {\left (d \sin \left (f x + e\right ) + c\right )}^{n} \cos \left (f x + e\right )^{2} \,d x } \]
[In]
[Out]
Timed out. \[ \int \cos ^2(e+f x) (a+b \sin (e+f x))^2 (c+d \sin (e+f x))^n \, dx=\int {\cos \left (e+f\,x\right )}^2\,{\left (a+b\,\sin \left (e+f\,x\right )\right )}^2\,{\left (c+d\,\sin \left (e+f\,x\right )\right )}^n \,d x \]
[In]
[Out]